import { saveUser } from './localStorage';

// 初始化本地数据
export const initLocalData = () => {
  // 创建一个测试用户
  const testUser = {
    id: 1,
    username: 'testuser',
    email: 'test@edu.cn',
    registerDate: new Date().toISOString(),
    uploadCount: 10,
    downloadCount: 5,
    ratio: 2.0,
    isAdmin: false
  };

  // 保存用户信息到本地存储
  saveUser(testUser);

  // 设置登录状态
  localStorage.setItem('token', 'local-test-token');
};

// 清除本地数据
export const clearLocalData = () => {
  localStorage.clear();
}; 